This invention relates to a display and edit device, a display method and a program product and is more in particular in the technical field of carrying out a specified process on a program including function blocks by outputting data related to these blocks.
Programmable logic controllers (PLC) installed at a production site to be in charge of a factory automation system are usually adapted to carry out cyclic operations of processes such as taking signals inputted through an input unit into an I/O memory of a CPU unit (“IN-refresh”), carrying out calculations based on a user program preliminarily registered in a ladder diagram (“calculation”), writing the results of such calculation in the I/O memory to transmit them to an output unit (“OUT-refresh”) and thereafter carrying out a so-called peripheral service process.
The aforementioned user program is usually created by a ladder program capable of using function blocks established according to JIS B3503 (1997). Input and output parameters, internal variables and operations (algorithms) of the function block are established by using a language element called function block definition. When a function block is incorporated in a user program, copies referred to as function block instances are created by instantiating (or invoking) this function block definition and such function block instances are written in a ladder program. Thus, when instances based on the same function block definition are used at a plurality of locations, each is instantiated such that a plurality of function block instances are created and incorporated at each of the localities within the program. Each function instance is given its unique instance name and identified uniquely on the basis of its instance name. A function block definition may be defined so as to call another function block definition in its algorithm.
In other words, one or more function block instances can be created from one function block definition. Zero or any specified number of other function blocks may be called from one function block definition.
Function block definitions and functional block instances will be explained next by way of an example. Let us assume that function block definitions A and B are defined as shown in FIG. 1 which is a ladder diagram showing the content of the definitions of the algorithm of the function block definition. As can be seen from this definition, function block definition A is calling different function block definition B. When these function block definitions A are actually used in a user program, they are instantiated with into function block instances with instance names I-1 and I-2. Function block definitions B are also invoked although their instance names are not shown. FIG. 1 shows an example where two instances (copies) with instance names I-1 and I-2 are created from one function block definition A and one function block instance B is called from one function block instance A.
Although this example has a simple structure of one function block definition A calling only one function block B definition, the actual structure may be different. FIG. 2 shows an example wherein function block definitions are called sequentially several times hierarchically such as function block definition FB3 which is called by function block definition FB1 further calling another function block definition FB6, another example wherein one function block definition (such as FB3) is called by a plurality of different function blocks (such as FB1 and FB2) and still another example wherein one function block definition (such as FB2) calls a plurality of function block definitions (such as FB3 and FB4).
When a program is actually created where one function block definition is called by a plurality of function block definitions as shown in FIG. 2, each function block is instantiated and the program will be of a structure of having a separate function block instance below each function block instance. Explained more in detail with reference to FIG. 3, two function block instances with instance names Inst1 and Inst2 are created as function block definitions FB1 and FB2 are instantiated. Instance name Inst1.FB3 created by invoking function block definition FB3 is connected below function block instance with instance name Inst1 and instance name Inst1.FB3.FB6 created by invoking function block FB6 is connected below function block instance with instance name Inst1.FB3. Instance names Inst2.FB3 and Inst2.FB4 are connected below function block instance with instance name Inst2, and instance name Inst2.FB3.FB6 is connected below instance name Inst2.FB3. In summary, the structure relationships of function block definition declarations and function block instances are different.
Programming devices (or display and edit devices) for creating new programs and editing (or debugging) already created programs are adapted to display a program as it is examined and edited. FIG. 4 shows an example of a displayed function block, a list of function block definitions appearing on the left-hand side and a detailed definition of a selected function block definition on the right-hand side. In the example of FIG. 4, the content of definitions in the algorithm of the function block definition is displayed as a ladder diagram.
When the detailed content of definitions of a function block definition is displayed in the window on the right-hand side, it can be redefined by correcting the content of the definitions of the displayed function block definition and the corrected items are reflected on the function block instance. When the content of a function block instance is displayed, the content of the definitions cannot be corrected but the status of its operation can be monitored.
Japanese Patent Publication Tokkaihei 9-212213 has disclosed a monitor tool for a programmable controller system adapted to display a list on the left-hand side of the display screen and the contents of a selected one on the list on the right-hand side of the screen but this prior art system had problems as will be explained below.
Firstly, since the list on the left-hand side of the display screen shows nothing but the function block definitions, the user can ascertain what kinds of function blocks are present but cannot easily understand the relationship of their connections. Since the structure relationship among function block definitions is different from that among function block instances where there is a function block that is calling another function block, as shown in FIGS. 2 and 3, it was difficult to understand their structure relationship.
Secondly, although the algorithm (the ladder diagram in the example of FIG. 4) displayed on the right-hand side of the display screen could be either a function block definition of a function block instance, the displayed ladder diagram was the same for both a function block definition and a function block instance. Thus, it was not easy to understand by a quick glance at the display whether what is being displayed is a function block definition or a function block instance.
Thirdly, when two or more function block instances are created from one function block definition and being used (such as FB3 and FB6 in the example of FIG. 3), although the function block instances are displayed on the programming device, it is difficult to distinguish which instance is being displayed.
Fourthly, when a programming device is being used to switch from one display screen of a program calling a certain function block to another display screen for the function block that is being called, both a function block definition and a function block instance can be an object of display but which is going to be displayed depends on the content of the process. In the prior art technology, the object of display was preliminarily determined (such as the function block definition). Thus, if the user wanted to have the function block instance displayed, the display screen had to be switched over and it was a cumbersome practice.
Fifthly, it was difficult while the algorithm of a function block instance is being displayed on the display screen to call the declaration of the function block definition from which the copy was made, say, for the purpose of editing.